//
//  UILabel+Addition.m
//  HowToDo
//
//  Created by Stan on 2017-01-04.
//  Copyright © 2017 KY. All rights reserved.
//

#import "UILabel+Addition.h"

@implementation UILabel (Addition)

//使用UIColor创建文本
+ (instancetype)hm_labelWithText:(NSString *)text fontSize:(CGFloat)fontSize color:(UIColor *)color {
    UILabel *label = [[UILabel alloc] init];
    
    label.text = text;
    label.font = [UIFont systemFontOfSize:fontSize];
    label.textColor = color;
    
    return label;
}

//使用 16进制颜色创建文本
+ (instancetype)hm_labelWithText:(NSString *)text fontSize:(CGFloat)fontSize colorWithHex:(uint32_t)hex{
    UILabel *label = [[UILabel alloc] init];
    
    label.text = text;
    label.font = [UIFont systemFontOfSize:fontSize];
    label.textColor = [UIColor colorWithHex:hex];
    
    return label;
}

+ (instancetype)hm_labelWithText:(NSString *)text fontSize:(CGFloat)fontSize color:(UIColor *)color TextAlignment:(NSTextAlignment)textAlignment{
    UILabel *label = [[UILabel alloc] init];
    
    label.text = text;
    label.font = [UIFont systemFontOfSize:fontSize];
    label.textColor = color;
    label.textAlignment = textAlignment;

    return label;
}

@end
